package cn.longge.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import cn.longge.entity.WorkOrder;
import cn.longge.mapper.WorkOrderMapper;
import cn.longge.service.IWordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;
@Service
@Transactional
public class WorkServiceImpl extends BaseServiceImpl<WorkOrder> implements IWordService {
    @Autowired
    private WorkOrderMapper workOrderMapper;

    @Override
    public PageInfo selectByPage(int page,int pageSize,Map<String,Object> params) {
        PageHelper.startPage(page,pageSize);
        List<WorkOrder> workOrders = workOrderMapper.selectByCondition(params);
        PageInfo pageInfo = new PageInfo(workOrders);
        return pageInfo;
    }

    @Override
    public WorkOrder selectDetail(int id) {
        return workOrderMapper.selectDetail(id);
    }
}
